<!DOCTYPE html>
<html>
<head>
	<!-- 设置浏览器不缓存 -->
    <META HTTP-EQUIV="pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
    <META HTTP-EQUIV="expires" CONTENT="0">
	<!-- Content-Type -->
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<!-- Favicon -->
	<link rel="shortcut icon" href="./images/logo.png">
	<title>企业服务共享中心</title>
	<!--stylesheets-->
	<link rel="stylesheet" href="./plugins/element/index.css">
	<script src="./plugins/vue/vue.js"></script>
	<script src="./plugins/element/index.js"></script>
	<script src="./plugins/axios/axios.min.js"></script>
	<script src="./plugins/QRCode/qrcode.js"></script>
	<script src="./js/common/public.js?v=0.8.0.3"></script>
	<!-- 自定义样式表 -->
	<link rel="stylesheet" href="./css/base.css?v=0.8.0.3">
</head>
<body>
<div id="app">
<template>
<el-container class="maincontainer">
	<el-container class="submaincontainer">
		<el-card class="box-card" style="position:relative;width:330px" shadow="never" v-show="leftbar_show">
		  <div style="position:absolute;left:0;top:0;right:0;bottom:0;overflow-y:auto;overflow-x:hidden;padding-left: 20px;padding-top: 20px;padding-right: 20px;">
			<el-form :model="queryForm" ref="queryForm" >
					<el-form-item label="关键字" prop="keyword"  maxlength="20" autocomplete="off">
					  <el-input v-model="queryForm.keyword"></el-input>
					</el-form-item>
					<el-checkbox-group v-model="queryForm.status">
						<el-form-item label="状态" prop="type">
						  <el-checkbox label="未抽奖">未抽奖</el-checkbox>
						  <el-checkbox label="抽奖中">抽奖中</el-checkbox>
						  <el-checkbox label="已抽奖">已抽奖</el-checkbox>
						</el-form-item>
					</el-checkbox-group>
					<el-form-item label="日期" prop="date" >
						<el-date-picker style="width:235px"
							value-format="yyyy-MM-dd"
							  v-model="queryForm.date"
							  type="daterange"
							  width="100"
							  align="right"
							  unlink-panels
							  range-separator="至"
							  start-placeholder="开始日期"
							  end-placeholder="结束日期"
							  :picker-options="pickerOptions">
						</el-date-picker>
					</el-form-item>
				  <el-form-item>
					<el-button size="small" type="primary" @click.native.prevent="start" style="position:fixed;left:20px;bottom:5px;">查询</el-button>
				  </el-form-item>
			</el-form>
		  </div>
		</el-card>
		<el-card class="box-card" style="width:100%" shadow="never">
		  <div slot="header" class="clearfix">
		  <i v-on:click="showLeftBar()" v-bind:class="[leftbar_show ? 'el-icon-s-fold' : 'el-icon-s-unfold']" style="color:#409EFF;cursor:pointer;"></i>
			<span>抽奖列表</span>
			<el-button-group style="float: right;margin-top:0px;">
					<el-tooltip v-for="item in toolbar" class="item" effect="dark" v-bind:content="item.content" placement="top-start">
						  <el-button size="small" v-bind:icon="item.icon" v-bind:type="item.type" @click="toolAction(item.content)">{{item.content}}</el-button>
					</el-tooltip>
			</el-button-group>
		  </div>
		  <div>
			  <el-table
			row-key="id"
			  border
				ref="multipleTable"
				@select='selectionChange'
				:data="pagedata"
				tooltip-effect="dark"
				:height="tableHeight"
				style="width: 100%;"
				@selection-change="handleSelectionChange">
				<el-table-column
				  type="selection"
				  min-width="55">
				</el-table-column>
				<el-table-column
				v-for="column in tablecolums"
				  v-bind:prop="column.prop"
				  v-bind:label="column.label"
				  v-bind:min-width="column.width"
				  show-overflow-tooltip>
				</el-table-column>
				<el-table-column label="操作" min-width="50">
				  <template slot-scope="scope">
					  <el-link type="primary" @click="edit(scope.$index, scope.row)">编辑</el-link>
					  <el-popover placement="right" width="100" trigger="click">
						<div>
							<span>{{scope.row.name}} 抽奖码</span></br>
							<div :id="scope.$index" style="width:70px; height:100px; margin-top:15px;text-align: center;"></div>
						</div>
					  	<el-link slot="reference" type="primary" class="cpLink" type="primary" @click="createQRcode(scope.$index, scope.row)"
					  	 v-model="QR">抽奖</el-link>
					  </el-popover>
				  </template>
				</el-table-column>
			  </el-table>
			  <div style="margin-top: 20px">
				<el-pagination
				@current-change="handleCurrentPageChange"
				:current-page="queryForm.pageNo"
				:page-sizes="queryForm.pagesizes"
				  :page-size="queryForm.pagesize"
				  background
				  layout="total,sizes, prev, pager, next"
				  :total="pagetotal">
				</el-pagination>
			  </div>			  
		  </div>
		</el-card>
	</el-container>
</el-container>
<el-dialog :close-on-click-modal="false"  title="抽奖信息" :visible.sync="dialogFormVisible" width="600px">
    <el-form :model="lotteryForm" :rules="lotteryRules" ref="lotteryForm" label-width="80px">
		<el-row :gutter="20">
		  <el-col :span="12">
			  <el-form-item label="姓名" prop="name"  >
				  <el-input v-model="lotteryForm.name" maxlength="10"></el-input>
			  </el-form-item>
		  </el-col>
		  <el-col :span="12">
			  <el-form-item label="手机号码" prop="tel"  >
				  <el-input v-model="lotteryForm.tel" maxlength="20"></el-input>
			  </el-form-item>
		  </el-col>
		</el-row>
		<el-row :gutter="20">
		  <el-col :span="12">
			  <el-form-item label="抽奖次数" prop="number"  >
				  <el-input v-model="lotteryForm.number" maxlength="2"></el-input>
			  </el-form-item>
		  </el-col>
		</el-row>
		<el-row :gutter="20">
		  <el-col :span="24">
			  <el-form-item label="单位名称" prop="company"  >
				  <el-input v-model="lotteryForm.company" maxlength="50"></el-input>
			  </el-form-item>
		  </el-col>
		</el-row>
		<el-row :gutter="20">
		  <el-col :span="24">
			  <el-form-item label="备注" prop="memo"  >
					<el-input v-model="lotteryForm.memo" type="textarea"></el-input>
			  </el-form-item>
		  </el-col>
		</el-row>
    </el-form>
  <div slot="footer" class="dialog-footer">
    <el-button @click="dialogFormVisible = false">取 消</el-button>
    <el-button type="primary" @click="cofirm">确 定</el-button>
  </div>
</el-dialog>
</template>
</div>
</body>
<script src="./js/lottery.js?v=0.8.0.3"></script>
</html>
